<extend name="Common/baseView"/>
<block name="body">
    <!-- 内容主体区域 -->
    <div id="personinfo" style="padding: 10px;">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
            <legend>添加管理员</legend>
        </fieldset>
        <div class="layui-row">
            <div class="layui-col-md5  layui-col-md-offset3">
                <form class="layui-form" action="{:U('updateAdmin')}" method="post">
                    <table class="layui-table" lay-even lay-skin="nob" lay-size="lg">
                        <colgroup>
                            <col width="150">
                            <col width="150">
                            <col width="150">
                        </colgroup>
                        <!--<thead>
                        <tr>
                            <th>项目</th>
                            <th>信息</th>
                        </tr>
                        </thead>-->
                        <tbody>
                        <tr></tr>
                        <tr>
                            <td>登录账号&nbsp;&nbsp;&nbsp;：</td>
                            <td><input type="text" name="account" lay-verify="required" placeholder=""
                                       autocomplete="off"
                                       class="layui-input" style="border-radius: 10px;"></td>
                        </tr>
                        <tr>
                            <td>登录密码&nbsp;&nbsp;&nbsp;：</td>
                            <td><input type="password" name="password" lay-verify="required" placeholder=""
                                       autocomplete="off"
                                       class="layui-input" style="border-radius: 10px;"></td>
                        </tr>
                        <tr>
                            <td>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名&nbsp;&nbsp;&nbsp;：</td>
                            <td><input type="text" name="name" lay-verify="required" placeholder="" autocomplete="off"
                                       class="layui-input" style="border-radius: 10px;"></td>
                        </tr>
                        <tr>
                            <td>超级管理员：</td>
                            <td>
                                <input class="status" name="status" value="1" type="hidden">
                                <input id="man" type="radio" name="status" value="0" lay-filter="radio" title="是">
                                <input id="woman" type="radio" name="status" value="1" lay-filter="radio" title="否">
                            </td>
                        </tr>
                        <tr>
                            <td>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱&nbsp;&nbsp;&nbsp;：</td>
                            <td><input type="text" name="email" lay-verify="email|required" placeholder="" autocomplete="off"
                                       class="layui-input" style="border-radius: 10px;"></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
                                <button class="layui-btn  layui-btn-normal"
                                        style="border-radius: 10px;margin-left: 80%;" lay-submit="" id="edit"
                                        lay-filter="demo1">保存
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>

    </div>
</block>
<block name="js">
    <script>
        $('#addadmin').addClass("layui-this");
        $('#auth').addClass("layui-nav-itemed");


        layui.use('element', function () {
            var element = layui.element;
        });
        layui.use('form', function () {
            var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功-->
            //但是，如果你的HTML是动态生成的，自动渲染就会失效
            //因此你需要在相应的地方，执行下述方法来手动渲染，跟这类似的还有 element.init();
            form.render();
            form.on('radio(radio)', function (data) {
//            console.log(data.elem); //得到radio原始DOM对象
//            console.log(data.value); //被点击的radio的value值
                /*
                 * 其实不用这么麻烦，因为后台使用的是empty判空操作
                 * */
                $('.status').val(data.value);
            });
        });

    </script>
</block>